
SHELL = /bin/sh

#----------------Version 0.3-------------------------------

#----------------------------------------------------------- SETUP

TOPDIR = ../../../../..
include $(TOPDIR)/Makefile.common

JAVAC = javac
JAVA = java -classpath $(SSFNET_TEST_CLASSPATH)
JAVA_M  = java -mx1024m -classpath $(SSFNET_TEST_CLASSPATH)

#----------------------------------------------------------- MAKE ALL

all: 	
	@echo --= version 0.3.1 =--	
	@echo targets are:host_5 rand_host_5 ComboDemo2 rand_Combo
	@echo             demux trace_rand

demux:
	@echo 'Demux flow_data/randComboDemo2.dat.0'
	(cd flow_data; $(JAVA) SSF.OS.NetFlow.Util.NHIDemuxer randComboDemo2.dat.0 netflow.0)
	@echo '---------------------------------DONE' 

trace_rand:
	@echo
	@echo '***** MUST make demux first *****'
	@cho
	@echo 'Spoof Flood Tracer test.'
	@echo
	$(JAVA) SSF.App.DDoS.SpoofFloodTracer traceRandConfig.dml > traceRand.out 2>&1
	@echo '------ Spoof Flood Tracer test COMPLETED (see traceRand.out)'
	@echo '------ records in flow_data/traceOutput.dat'
	@echo
rand_Combo:
	@echo
	@echo 'DDoS ComboDemo2 with randomly chosen DDoS clients'
	@echo
	$(JAVA) SSF.Net.Net 300 randComboDemo2.dml dictionary.dml $(TOPDIR)/examples/net.dml > randComboDemo2.out 2>&1
	@echo
	@echo '------- DDoS Rand ComboDemo2 COMPLETED (see randComboDemo2.out)'
	@echo

ComboDemo2:
	@echo
	@echo 'DDoS ComboDemo2'
	@echo
	$(JAVA) SSF.Net.Net 300 DDoSComboDemo2.dml dictionary.dml $(TOPDIR)/examples/net.dml > ComboDemo2.out 2>&1
	@echo
	@echo '--------- DDoS ComboDemo2 COMPLETED (see ComboDemo2.out)'
	@echo

host_5:
	@echo
	@echo 'DDoS host_5 demo'
	@echo
	$(JAVA) SSF.Net.Net 500 host_5.dml dictionary.dml $(TOPDIR)/examples/net.dml > host_5.out 2>&1
	@echo
	@echo '-------------- DDoS host_5 demo COMPLETED (see host_5.out)'
	@echo
	#$(JAVA) SSF.OS.NetFlow.Util.IpFlowSortor flow_data/host_5.dat.0 netflow.0 > flows_5.out
	#@echo
	#@echo '-------------- flow records sorted in flows_5.out'

rand_host_5:
	@echo
	@echo 'DDoS rand_host_5 demo'
	@echo
	$(JAVA) SSF.Net.Net 500 rand_host_5.dml dictionary.dml $(TOPDIR)/examples/net.dml > rand_host_5.out 2>&1
	@echo
	@echo '-------------- DDoS rand_host_5 demo COMPLETED (see rand_host_5.out)'
clean:
	rm -f *.out *~
	(cd flow_data; rm -f *.dat* *.*~)
